-- CALC_SAILOR_WRECKAGE_BONUS

-- 水手残骸奖励
-- @param user      玩家对象
return function(user)
    -- 1、40%概率：金币+100~1000
    -- 2、40%概率：探索点+10~100
    -- 3、20%概率：获得随机1阶宝物
    local rand = DungeonM.getRandSeed("sailor_wreckage_bonus");
    local ratio = rand % 100;
    local bonus;

    if ratio < 40 then
        bonus = { 2, "money", 100 + rand % 901, };
    elseif ratio < 80 then
        bonus = { 2, "search_point", 10 + rand % 91, };
    else
        -- 随机1阶宝物
        equipTable = ItemM.getEquipByRank(1);
        bonus = { 1, FormulaM.invoke("FETCH_BY_RAND", equipTable, rand), 1, };
    end

    return { ["bonus"] = bonus, };
end
